package request

import (
	"gitee.com/cjsn/topsdk/ability254/domain"
	"gitee.com/cjsn/topsdk/util"
)

type AlibabaSscSupplyplatformServiceInventoryEditRequest struct {
	/*
	   业务幂等键。该字段主要用于远程调用失败后的重试的场景，例如接口超时，调用方感知到失败，但服务端可能实际上已经成功了，这时如果发起一次重试请求，服务端需要通过bizId来识别是同一个请求，这样才不会重复增加库存值。对于同一个bizId，多次请求只会生效一次，后续的重复请求不会生效。对于批量操作时，如果部分key成功，部分key失败，重试请求时只会对未成功的key生效。     */
	BizId *string `json:"biz_id" required:"true" `
	/*
	   库存编辑列表。每次不超过100条     */
	EditDetails *[]domain.AlibabaSscSupplyplatformServiceInventoryEditEditDetailInventoryRequest `json:"edit_details" required:"true" `
	/*
	   服务提供者id。参考alibaba.ssc.supplyplatform.servicecapacity.save入参     */
	ProviderId *int64 `json:"provider_id" required:"true" `
	/*
	   服务提供者类型。参考alibaba.ssc.supplyplatform.servicecapacity.save入参     */
	ProviderType *string `json:"provider_type" required:"true" `
}

func (s *AlibabaSscSupplyplatformServiceInventoryEditRequest) SetBizId(v string) *AlibabaSscSupplyplatformServiceInventoryEditRequest {
	s.BizId = &v
	return s
}
func (s *AlibabaSscSupplyplatformServiceInventoryEditRequest) SetEditDetails(v []domain.AlibabaSscSupplyplatformServiceInventoryEditEditDetailInventoryRequest) *AlibabaSscSupplyplatformServiceInventoryEditRequest {
	s.EditDetails = &v
	return s
}
func (s *AlibabaSscSupplyplatformServiceInventoryEditRequest) SetProviderId(v int64) *AlibabaSscSupplyplatformServiceInventoryEditRequest {
	s.ProviderId = &v
	return s
}
func (s *AlibabaSscSupplyplatformServiceInventoryEditRequest) SetProviderType(v string) *AlibabaSscSupplyplatformServiceInventoryEditRequest {
	s.ProviderType = &v
	return s
}

func (req *AlibabaSscSupplyplatformServiceInventoryEditRequest) ToMap() map[string]interface{} {
	paramMap := make(map[string]interface{})
	if req.BizId != nil {
		paramMap["biz_id"] = *req.BizId
	}
	if req.EditDetails != nil {
		paramMap["edit_details"] = util.ConvertStructList(*req.EditDetails)
	}
	if req.ProviderId != nil {
		paramMap["provider_id"] = *req.ProviderId
	}
	if req.ProviderType != nil {
		paramMap["provider_type"] = *req.ProviderType
	}
	return paramMap
}

func (req *AlibabaSscSupplyplatformServiceInventoryEditRequest) ToFileMap() map[string]interface{} {
	fileMap := make(map[string]interface{})
	return fileMap
}
